home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
tests
/
unittests
/
utiltests.pyo
(
.txt
)
< prev
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
49 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import unittest
import util
import struct
class UtilTestingSuite(unittest.TestCase):
def testUnpackNames(self):
testdata = struct.pack('!HIB', 1, 0xFA0L, 3) + 'some extraneous data'
magic_hash = util.unpack_named('!HIBR', 'one', 'four thousand long', 'three', 'extra', testdata)
self.assertEquals(magic_hash['extra'], 'some extraneous data')
def testStorage(self):
s = util.Storage({
'key': 'value' })
self.assertEquals(s.key, 'value')
def testdocs(self):
import doctest as doctest
doctest.testmod(util)
def testBaseClasses(self):
class Shape(object):
pass
class Rectangle(Shape):
pass
class Square(Rectangle):
pass
self.assertEqual(set(util.baseclasses(Square)), set([
Rectangle,
Shape,
object]))
if __name__ == '__main__':
unittest.main()